import { initializeWidgetStore, WidgetStatus } from '@xw11/widget-container';
import { createEnum } from 'enumily';

export const WidgetKey = createEnum({
  A: 'A',
  B: 'B',
  C: 'C',
  D: 'D',
  E: 'E',
  F: 'F',
});

const initState = {
  [WidgetKey.A]: WidgetStatus.HIDDEN,
  [WidgetKey.B]: WidgetStatus.HIDDEN,
  [WidgetKey.C]: WidgetStatus.HIDDEN,
  [WidgetKey.D]: WidgetStatus.HIDDEN,
  [WidgetKey.E]: WidgetStatus.HIDDEN,
  [WidgetKey.F]: WidgetStatus.HIDDEN,
};

initializeWidgetStore({
  state: initState,
  groups: {
    hideGroup: [
      [WidgetKey.A, WidgetKey.B],
      [WidgetKey.A, WidgetKey.C],
    ],
    destroyGroup: [
      [WidgetKey.A, WidgetKey.D, WidgetKey.E, WidgetKey.F],
      [WidgetKey.B, WidgetKey.C],
    ],
  },
});
